package net.uhuijia.goods.skupropertyname.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import net.uhuijia.appbase.controller.BaseController;
import net.uhuijia.goods.skupropertyname.persistence.model.SkuPropertyName;
import net.uhuijia.goods.skupropertyname.persistence.model.SkuPropertyNameExample;
import net.uhuijia.goods.skupropertyname.service.SkuPropertyNameService;
import net.uhuijia.utils.StringHelper;


@RestController
@RequestMapping(value="/skupropertyname")
public class SkuPropertyNameController
     extends BaseController<SkuPropertyNameService,SkuPropertyName,SkuPropertyNameExample> {
	
	private SkuPropertyNameService skuPropertyNameService;
	@Autowired
	public void setUserMallService(SkuPropertyNameService skuPropertyNameService) {
		this.skuPropertyNameService = skuPropertyNameService;
	}
	
	/**
	 * 获取分类 集合 (根据父类codeId)
	 * @author 王文鑫  
	 * @date 2018年9月29日  
	 * @return
	 */
	@RequestMapping(value = "/getProNameById", method = RequestMethod.GET)
	@ResponseBody
	public SkuPropertyName getProNameById(String id) {
		SkuPropertyName skuPropertyName = null;
		if(StringHelper.isEmpty(id)){
			throw new IllegalArgumentException();//参数异常			
		}else{
			skuPropertyName = skuPropertyNameService.get(id);
		}
		return skuPropertyName;
	}
}